package com.tywj.buscustomerapp.view.item;

import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.support.annotation.NonNull;
import android.support.v7.widget.CardView;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.AnimationUtils;
import android.view.animation.ScaleAnimation;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RatingBar;
import android.widget.TextView;

import com.tywj.buscustomerapp.R;
import com.tywj.buscustomerapp.model.bean.PandaSelectBean;
import com.tywj.buscustomerapp.model.bean.TourismApp;
import com.tywj.buscustomerapp.utils.SpringScaleInterpolator;
import com.tywj.buscustomerapp.utils.ToastUtils;
import com.tywj.buscustomerapp.utils.myadapter.item.AdapterItem;
import com.tywj.buscustomerapp.view.myview.TaylorCardView;

public class PandaSelectItem implements AdapterItem<PandaSelectBean> {
    private ImageView imageView;
    private TextView title;
    private TextView price;
    private TextView oldPrice;
    private RatingBar stars;
    private TextView command;
    private LinearLayout cardview;
    private TaylorCardView card;

    @Override
    public int getLayoutResId() {
        return R.layout.panda_select_layout;
    }

    @Override
    public void bindViews(@NonNull View root) {
        imageView = root.findViewById(R.id.img);
        title = root.findViewById(R.id.title);
        price = root.findViewById(R.id.price);
        oldPrice = root.findViewById(R.id.old_price);
        stars = root.findViewById(R.id.stars);
        command = root.findViewById(R.id.command);
        cardview = root.findViewById(R.id.cardview);
        card = root.findViewById(R.id.card);
    }

    @Override
    public void setViews() {

    }

    @Override
    public void handleData(PandaSelectBean bean, int position) {
        title.setText(bean.getTitle());
        price.setText(bean.getPrice());
        oldPrice.setText(bean.getPldPrice());
        stars.setRating(bean.getStars());
        command.setText(bean.getComment()+"条点评");
        cardview.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ToastUtils.show("点击了");
            }
        });
        card.setOnclickListen(new TaylorCardView.OnClickLis() {
            @Override
            public void onClicked() {
                ToastUtils.show("点击了");
            }
        });
    }

}
